package com.thomasmoerman.dci3.domain

import com.thomasmoerman.dci3.frw.{Entity => SEntity}
import javax.persistence._
import javax.persistence.FetchType._

@Entity
class Bill extends SEntity {
 
  def this(debtor: Person = null, creditor: Person = null, amount: Double = 0.0, comment: String = null) {
	this()
	
	this.debtor = debtor
	this.creditor = creditor
	this.amount = amount
	this.comment = comment
  }

  @ManyToOne var debtor: Person = _
  
  @ManyToOne var creditor: Person = _
  
  @Basic var amount: Double = _
  
  @Basic var paid: Boolean = false
  
  @Basic var comment: String = _
	
  def markAsPaid = {paid = true}
  
}